Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Terms and Conditions For Invitation Form #684

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

aaronskiba
Copy link
Collaborator

Fixes #665

Changes proposed in this PR:

  1. Add terms and conditions checkbox to the devise invitation form
    • This was done by copy/pasting the code from app/views/shared/_create_account_form.html.erb
    • In addition to the copy/paste, required: true was added. As a result, the invitation form cannot be submitted unless the checkbox is currently checked.
  2. Add accept_terms to devise_parameter_sanitizer.permit(). This enables the accept_terms value to be updated within the update method of Devise::InvitationsController

This adds the terms and conditions checkbox to the devise invitation form. In addition, `accept_terms` has been added to devise_parameter_sanitizer.permit(). This change is required in order for `accept_terms` to be updated within the update method of Devise::InvitationsController.
This change results in the user being unable to submit the invitation form unless the accept terms checkbox is actually checked.
The checkbox handling here is a bit different from the checkbox handling within the create account section of the homepage (see the create method within RegistrationsController). We could do the same here, but it would require a bit more work. Specifically, we'd have to override the Devise::InvitationsController update method within InvitationsController. Also, a bit of extra handling would be required within the DeviseController require_no_authentication method that we are already overriding within InvitationsController.
Copy link
Collaborator

@200455939-yashu 200455939-yashu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Work 🤝

@aaronskiba aaronskiba merged commit c0e2cb1 into integration Apr 8, 2024
13 checks passed
@aaronskiba aaronskiba deleted the aaron/issues/665 branch April 8, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants